/*
 * @Author: wangc
 * @Date: 2020-07-28 19:26:51
 * @LastEditTime: 2020-08-29 21:27:43
 * @Description: 
 */
// import { resolve } from 'core-js/fn/promise'
import Vue from 'vue'
import VueRouter from 'vue-router'
// import Login from '../views/pc/Login.vue'

Vue.use(VueRouter)

// 解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题
const originalPush = VueRouter.prototype.replace
VueRouter.prototype.replace = function replace(location, onResolve, onReject) {
    if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
    return originalPush.call(this, location).catch(err => err)
}
// const routes = [
//     path:'/',

// ]

const router = new VueRouter({
    mode: 'history',
    routes:[
        {
            path:'/login',
            component:resolve => require(['../view/Login.vue'],resolve)
        },
    ]
})
export default router